// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_BOM_ITEM_MATERIAL
// * CreateDate    : 2014-06-05 18:29:39
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:29:39
// * LastChanger   : 2014-06-05 18:29:39
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class BomItemMaterialEntity : EntityBase
    {
        public BomItemMaterialTable TableSchema
        {
            get
            {
                return BomItemMaterialTable.Current;
            }
		}
		
		public BomItemMaterialEntity()
        {

        }
		
		public BomItemMaterialEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.BomItemId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_ITEM_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.PickingModel = Convert.ToString(CommonFunctions.ToObject(dr["PICKING_MODEL"]));
			this.NetSize = Convert.ToString(CommonFunctions.ToObject(dr["NET_SIZE"]));
			this.GrossSize = Convert.ToString(CommonFunctions.ToObject(dr["GROSS_SIZE"]));
			this.UnitWeight = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_WEIGHT"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.ManufacturingType = Convert.ToString(CommonFunctions.ToObject(dr["MANUFACTURING_TYPE"]));
        }
		
		public BomItemMaterialEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.BomItemId = Convert.ToString(CommonFunctions.ToObject(dr["BOM_ITEM_ID"]));
			this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.PickingModel = Convert.ToString(CommonFunctions.ToObject(dr["PICKING_MODEL"]));
			this.NetSize = Convert.ToString(CommonFunctions.ToObject(dr["NET_SIZE"]));
			this.GrossSize = Convert.ToString(CommonFunctions.ToObject(dr["GROSS_SIZE"]));
			this.UnitWeight = Convert.ToDecimal(CommonFunctions.ToObject(dr["UNIT_WEIGHT"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
			this.ManufacturingType = Convert.ToString(CommonFunctions.ToObject(dr["MANUFACTURING_TYPE"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return BomItemMaterialTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(BomItemMaterialTable.C_ID)); }
            set { SetData(BomItemMaterialTable.C_ID, value); }
        }
		
        [DataMember]
        public string BomItemId
        {
            get { return Convert.ToString(GetData(BomItemMaterialTable.C_BOM_ITEM_ID)); }
            set { SetData(BomItemMaterialTable.C_BOM_ITEM_ID, value); }
        }
		
        [DataMember]
        public string ProductId
        {
            get { return Convert.ToString(GetData(BomItemMaterialTable.C_PRODUCT_ID)); }
            set { SetData(BomItemMaterialTable.C_PRODUCT_ID, value); }
        }
		
        [DataMember]
        public string MaterialId
        {
            get { return Convert.ToString(GetData(BomItemMaterialTable.C_MATERIAL_ID)); }
            set { SetData(BomItemMaterialTable.C_MATERIAL_ID, value); }
        }
		
        [DataMember]
        public string PickingModel
        {
            get { return Convert.ToString(GetData(BomItemMaterialTable.C_PICKING_MODEL)); }
            set { SetData(BomItemMaterialTable.C_PICKING_MODEL, value); }
        }
		
        [DataMember]
        public string NetSize
        {
            get { return Convert.ToString(GetData(BomItemMaterialTable.C_NET_SIZE)); }
            set { SetData(BomItemMaterialTable.C_NET_SIZE, value); }
        }
		
        [DataMember]
        public string GrossSize
        {
            get { return Convert.ToString(GetData(BomItemMaterialTable.C_GROSS_SIZE)); }
            set { SetData(BomItemMaterialTable.C_GROSS_SIZE, value); }
        }
		
        [DataMember]
        public decimal UnitWeight
        {
            get { return Convert.ToDecimal(GetData(BomItemMaterialTable.C_UNIT_WEIGHT)); }
            set { SetData(BomItemMaterialTable.C_UNIT_WEIGHT, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(BomItemMaterialTable.C_REMARK)); }
            set { SetData(BomItemMaterialTable.C_REMARK, value); }
        }
		
        [DataMember]
        public string ManufacturingType
        {
            get { return Convert.ToString(GetData(BomItemMaterialTable.C_MANUFACTURING_TYPE)); }
            set { SetData(BomItemMaterialTable.C_MANUFACTURING_TYPE, value); }
        }
		
		#endregion
	}
	
	
}	

